/*
{
"状态":1,
"名称":"更新-字典主表信息",
"作者":"陈泽椿",
"创建时间":"2018-06-30",
"功能":"更新-字典主表信息",
"log": [
	{"date":"06-01" , "dev" :"hzhh" , "content" : ""}
]
}
*/

declare @dict_key int,@dict_name varchar(100) ,@dict_type varchar(100)
set @dict_key = '{dict_key}'
set @dict_name = '{dict_name}'
set @dict_type = '{dict_type}'



--校验信息
if isnull(@dict_name,'')=''
begin 
	RAISERROR ('SQL:字典名称不允许为空', 16 ,1 ) ; 
	return 
end 
 
if EXISTS(SELECT * FROM y_dict_master WHERE [dict_key] <> @dict_key and [dict_name]=@dict_name )
begin
	RAISERROR ('SQL:字典名称已经存在', 16 ,1 ) ; 
	return 
end

update [dbo].[y_dict_master] set
[dict_name] = @dict_name ,
[dict_type] = @dict_type ,
[update_time] = getdate()
where [dict_key] = @dict_key
